<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div class="panel panel-default">
    <div class="panel-heading">基本信息</div>
    <div class="panel-body" id="id_info_container">
        <!--<div id="id_data0" class="alert alert-info">-->
            <!--服务器名称：-->
        <!--</div>-->
        <!--<div id="id_data1" class="alert split-line-text">-->
            <!--在线人数：-->
        <!--</div>-->
    </div>
</div>

<script>
    $(document).ready(function(){
        console.log("api_get_server_info")
        api_get_server_info(function(success, errmsg, data){
            if (data != null && data != undefined) {
                // 遍历数据
                var infos = data.infos
                var str = JSON.stringify(data);
                console.log(str)
                var tableElm = document.getElementById("id_info_container")
                for (var i in infos) {
                    var info = infos[i]
                    info = info.replace("/\t/g","，")
                    console.log(info)
                    var itemDiv = document.createElement("div")
                    if (i % 2 == 0) {
                        itemDiv.setAttribute("class", "alert alert-info")
                    } else {
                        itemDiv.setAttribute("class", "alert split-line-text")
                    }
                    itemDiv.innerHTML = info
                    tableElm.appendChild(itemDiv)
                    i = i + 1
                }
            }
        });
    });
</script>
</body>
</html>